397d45
@@ -106,7 +106,7 @@
public class JettyHttpComponent extends HttpComponent {
     public void connect(HttpConsumer consumer) throws Exception {
         // Make sure that there is a connector for the requested endpoint.
         JettyHttpEndpoint endpoint = (JettyHttpEndpoint)consumer.getEndpoint();
-        String connectorKey = endpoint.getProtocol() + ":" + endpoint.getHttpUri().getHost() + ":" + endpoint.getPort();
+        String connectorKey = getConnectorKey(endpoint);
 
         synchronized (connectors) {
             ConnectorRef connectorRef = connectors.get(connectorKey);
@@ -163,8 +163,8 @@
public class JettyHttpComponent extends HttpComponent {
     public void disconnect(HttpConsumer consumer) throws Exception {
         // If the connector is not needed anymore then stop it
         HttpEndpoint endpoint = consumer.getEndpoint();
-        String connectorKey = endpoint.getProtocol() + ":" + endpoint.getPort();
-
+        String connectorKey = getConnectorKey(endpoint);
+        
         synchronized (connectors) {
             ConnectorRef connectorRef = connectors.get(connectorKey);
             if (connectorRef != null) {
@@ -177,6 +177,10 @@
public class JettyHttpComponent extends HttpComponent {
             }
         }
     }
+    
+    private String getConnectorKey(HttpEndpoint endpoint) {
+        return endpoint.getProtocol() + ":" + endpoint.getHttpUri().getHost() + ":" + endpoint.getPort();
+    }
 
     // Properties
     // -------------------------------------------------------------------------
@@ -266,7 +270,7 @@
public class JettyHttpComponent extends HttpComponent {
     @Override
     protected void doStop() throws Exception {
         for (ConnectorRef connectorRef : connectors.values()) {
-            connectorRef.connector.stop();
+            connectorRef.connector.stop();            
         }
         connectors.clear();
 
